package ca.badenhorst.ourtrition.model;

/**
 * Created with IntelliJ IDEA.
 * User: wade
 * Date: 11/03/14
 * Time: 1:21 PM
 * To change this template use File | Settings | File Templates.
 */
public class FoodGroup implements Comparable<FoodGroup>{

    public static final String GROUP_CODE = "groupCd";
    public static final String DESCRIPTION = "description";

    private String groupId;
    private String description;

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public String toString() {
        return "FoodGroup{" +
                "groupId='" + groupId + '\'' +
                ", description='" + description + '\'' +
                '}';
    }

    @Override
    public int compareTo(FoodGroup another) {
        if (another == null || another.getDescription()==null){
            return 1;
        }
        if (this.getDescription()==null){
            return -1;
        }

        return this.getDescription().compareTo(another.getDescription());
    }
}
